package com.push.web.controller;

import com.push.web.domain.BizDailyGrowth;
import com.push.web.service.IBizDailyGrowthService;
import com.push.web.service.impl.BizDailyGrowthSeriviceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/information/bizDailyGrowth")
public class BizDailyGrowthController {
    @Autowired
    private IBizDailyGrowthService BizDailyGrowthService;

    public int deleteBizDailyGrowth() {
        return BizDailyGrowthService.deleteBizDailyGrowth();
    }


    public int insertBizDailyGrowth() {
        return BizDailyGrowthService.insertBizDailyGrowth();
    }

    @GetMapping("/list")
    public List<BizDailyGrowth> selectBizDailyGrowthList(){
        deleteBizDailyGrowth();
        insertBizDailyGrowth();
        return BizDailyGrowthService.getList();
    }

    @GetMapping("/range")
    public List<BizDailyGrowth> findByDateRange(String startDate, String endDate) {
        // 这里需要实现根据开始日期和结束日期查询的逻辑
        // 可以通过请求参数传递日期，例如 /api/biz-daily-growth/range?startDate=2023-01-01&endDate=2023-01-31
        return BizDailyGrowthService.findByDateRange(startDate, endDate);
    }
}
